Fix Array interface (#10886) - #11294
Closed
falsandtru (falsandtru) wants to merge 1 commit into
Closed
Conversation
Member
|
What's the bug tracking this change? |
Contributor
Author
|
Fixes #10886 |
Contributor
Author
|
Can someone review this? |
Contributor
|
sorry for the late reply. can you refresh this PR? |
Contributor
Author
|
done |
Contributor
Author
|
now updating |
Contributor
Author
There was a problem hiding this comment.
#10886 is not acceptable because of confusing with tuple types.
| >regExpExecArrayValue.slice() : string[] | ||
| >regExpExecArrayValue.slice : (start?: number, end?: number) => string[] | ||
| >regExpExecArrayValue.slice() : RegExpExecArray | ||
| >regExpExecArrayValue.slice : (start?: number, end?: number) => RegExpExecArray |
Contributor
Author
There was a problem hiding this comment.
Wrong, must return string[]. It can avoid by overloading in RegExpExecArray and RegExpMatchArray.
| >t.slice() : [number, string] | ||
| >t.slice : { (start?: number, end?: number): (string | number)[]; (): [number, string]; } | ||
| >t.slice : { (start?: number, end?: number): [number, string]; (): [number, string]; } | ||
| >t : [number, string] |
Contributor
Author
There was a problem hiding this comment.
Wrong, concat and slice methods must not return this type when it is a tuple type. It cannot avoid.
Contributor
Author
|
improved. i tried to improve RegExp{Exec,Match}Array too, interface RegExpMatchArray extends Array<string> {
index?: number;
input?: string;
concat(): string[];
slice(start?: 0): string[];
}
interface RegExpExecArray extends Array<string> {
index: number;
input: string;
concat(): string[];
slice(start?: 0): string[];
}but i didn't complete that because it makes 637 errors. i cannot fix such a lot of errors. |
Contributor
Author
|
Mohamed Hegazy (@mhegazy) can you review before conflicting again? |
Contributor
Author
Contributor
Author
Contributor
|
Fixed by #12784 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.